Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Use "coverage" preset instead of "Coverage" build type and document it #1251

Closed
wants to merge 2 commits into from

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Mar 28, 2023

Using -DCMAKE_BUILD_TYPE=Coverage to configure the build for coverage analysis has a flaw as build types are not defined at the configuration stage for multi-config generators.

This PR implements the idea suggested here.

Please note that both added to the README.md commands, cmake --build build and ctest --test-dir build, accept the -j $(nproc) option to parallelize work.

Drafted as it is based on #1234.

"displayName": "Build for coverage analysis",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://clang.llvm.org/docs/SourceBasedCodeCoverage.html clang supports this too, so no need to set a default here, I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't clang require the use of the llvm-cov tool, which is currently undocumented in the README.md?

@theuni
Copy link
Contributor

theuni commented Apr 27, 2023

Concept ACK assuming one can stack multiple presets at once.

@hebasto hebasto marked this pull request as ready for review April 27, 2023 10:37
@hebasto
Copy link
Member Author

hebasto commented Apr 27, 2023

Rebased.

@theuni
Copy link
Contributor

theuni commented Apr 27, 2023

After a discussion about this in-person, we've found drawbacks in the build type approach as well as the preset one.

Instead, let's just do the simple thing and hook up a new option.

@hebasto
Copy link
Member Author

hebasto commented Apr 29, 2023

After a discussion about this in-person, we've found drawbacks in the build type approach as well as the preset one.

Instead, let's just do the simple thing and hook up a new option.

Closing in favour of #1291.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants